package org.spring.boot.fusion.fallback;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.netflix.zuul.filters.route.FallbackProvider;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.stereotype.Component;

@Component
public class ServerFallback implements FallbackProvider {

	private final String ROUTE_SCOPE = "*";

	@Autowired
	private FallbackServiceImpl clientHttpResponse;

	public String getRoute() {
		return ROUTE_SCOPE;
	}

	@Override
	public ClientHttpResponse fallbackResponse(String route, Throwable cause) {
		return clientHttpResponse;
	}

}